/* PWA安装提示样式 */
.pwa-install-banner {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1000;
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
    max-width: 400px;
    margin: 0 auto;
}

.pwa-install-banner.show {
    transform: translateY(0);
    opacity: 1;
}

.pwa-install-content {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.pwa-install-icon {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.pwa-install-info {
    flex: 1;
    min-width: 200px;
}

.pwa-install-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.pwa-install-description {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.4;
}

.pwa-install-actions {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.pwa-install-btn {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pwa-install-btn:hover {
    background: #f8f9fa;
    transform: translateY(-1px);
}

.pwa-install-btn:active {
    transform: translateY(0);
}

.pwa-install-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.pwa-install-close {
    background: transparent;
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.pwa-install-close:hover {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.5);
}

/* 安装进度指示器 */
.pwa-install-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.3);
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.pwa-install-progress-bar {
    height: 100%;
    background: white;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 0 0 12px 0;
}

/* iOS Safari 特殊样式 */
@supports (-webkit-touch-callout: none) {
    .pwa-install-banner {
        bottom: 80px; /* 为Safari工具栏留出空间 */
    }
}

/* 桌面端样式 */
@media (min-width: 768px) {
    .pwa-install-banner {
        bottom: 30px;
        left: auto;
        right: 30px;
        max-width: 380px;
    }
    
    .pwa-install-content {
        flex-wrap: nowrap;
    }
    
    .pwa-install-info {
        min-width: auto;
    }
}

/* 移动端适配 */
@media (max-width: 480px) {
    .pwa-install-banner {
        bottom: 10px;
        left: 10px;
        right: 10px;
        padding: 14px 16px;
        border-radius: 10px;
    }
    
    .pwa-install-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    .pwa-install-title {
        font-size: 15px;
    }
    
    .pwa-install-description {
        font-size: 12px;
    }
    
    .pwa-install-btn,
    .pwa-install-close {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .pwa-install-actions {
        width: 100%;
        justify-content: space-between;
        margin-top: 12px;
        margin-left: 0;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .pwa-install-banner {
        background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
        box-shadow: 0 10px 30px rgba(0,0,0,0.4);
    }
    
    .pwa-install-btn {
        background: #3498db;
        color: white;
    }
    
    .pwa-install-btn:hover {
        background: #2980b9;
    }
    
    .pwa-install-close {
        border-color: rgba(255,255,255,0.2);
    }
    
    .pwa-install-close:hover {
        background: rgba(255,255,255,0.05);
    }
}

/* 动画效果 */
@keyframes slideInUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideOutDown {
    from {
        transform: translateY(0);
        opacity: 1;
    }
    to {
        transform: translateY(100%);
        opacity: 0;
    }
}

.pwa-install-banner.animate-in {
    animation: slideInUp 0.4s ease-out;
}

.pwa-install-banner.animate-out {
    animation: slideOutDown 0.3s ease-in;
}

/* 安装成功提示 */
.pwa-install-success {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%) !important;
}

.pwa-install-success .pwa-install-icon::before {
    content: "✅";
}

/* 安装失败提示 */
.pwa-install-error {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%) !important;
}

.pwa-install-error .pwa-install-icon::before {
    content: "❌";
}

/* 隐藏类 */
.pwa-install-hidden {
    display: none !important;
}

/* 可访问性增强 */
.pwa-install-banner:focus-within {
    outline: 2px solid white;
    outline-offset: 2px;
}

.pwa-install-btn:focus,
.pwa-install-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* 减少动画偏好 */
@media (prefers-reduced-motion: reduce) {
    .pwa-install-banner,
    .pwa-install-progress-bar,
    .pwa-install-btn,
    .pwa-install-close {
        transition: none;
    }
    
    .pwa-install-banner.animate-in,
    .pwa-install-banner.animate-out {
        animation: none;
    }
}